// 过滤器
// 转换时间戳
let transferTime = (value) => {
  if (value) {
    return new Date(parseInt(value)).toLocaleDateString()
  } else {
    return "未知";
  }
}
//精确到小时的时间戳
let transferTime2 = (value) => {
  if (value) {
    return new Date(parseInt(value)).toLocaleString().replace(/:\d{1,2}$/, ' ')
    //return new Date(parseInt(value)).toLocaleString().replace(/:\d{1,2}$/,' ')
  } else {
    return "未知";
  }
}
let transMeetTime = (value) => {
  if (value) {
    let time = new Date(value);
    let year = time.getFullYear();
    let month = time.getMonth() + 1;
    let day = time.getDate();
    let hours = time.getHours();
    let minutes = time.getMinutes()
    if (month < 10) {
      month = "0" + "" + month
    };
    if (day < 10) {
      day = "0" + "" + day
    };
    if (hours < 10) {
      hours = "0" + "" + hours
    };
    if (minutes < 10) {
      minutes = "0" + "" + minutes
    };
    return `${year}/${month}/${day} ${hours}:${minutes}`

  } else {
    return "未知";
  }
}
export default {
  transferTime,
  transferTime2,
  transMeetTime

}
